package com.xxdemo.media;

import org.apache.commons.lang3.StringUtils;

public class FileUploadResult {
    private String status;
    private String message;

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    private FileUploadResult() {
    }

    public static FileUploadResult success(String successMessage) {
        FileUploadResult r = new FileUploadResult();
        r.setStatus("200");
        r.setMessage(StringUtils.defaultString(successMessage, "SUCCESS"));
        return r;
    }

    public static FileUploadResult success() {
        return FileUploadResult.success("SUCCESS");
    }

    public static FileUploadResult error(String errorMessage) {
        FileUploadResult r = new FileUploadResult();
        r.setStatus("500");
        r.setMessage(StringUtils.defaultString(errorMessage, "ERROR"));
        return r;
    }

    public static FileUploadResult error() {
        return FileUploadResult.error("ERROR");
    }
}
